#include <iostream>
using namespace std;
int main()
{
	int s,n,i,j;
	cin>>s>>n;
	i=(4*s-n)/2;
	j=s-i;
	cout<<i<<" "<<j;
	return 0;
}
